<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="../templates/masterLayout.xhtml">
	<ui:define name="title">#{messages.fileUpload}</ui:define>
	<ui:define name="content">
		<h:form id="openUploadDialogForm">
			<h:commandButton id="openUploadDialog" value="Upload file">
				<rich:componentControl target="popup" operation="show" />
			</h:commandButton>
		</h:form>
		<rich:popupPanel id="popup" modal="true" autosized="true"
			resizeable="false" moveable="false">
			<f:facet name="header">
				<h:outputText value="File upload" />
			</f:facet>
			<f:facet name="controls">
				<h:outputLink id="close" value="#"
					onclick="#{rich:component('popup')}.hide(); return false;">
					<h:outputText value="X" />
				</h:outputLink>
			</f:facet>
			<h:form id="fileUploadForm">
				<rich:fileUpload id="upload"
					fileUploadListener="#{fileUploadBean.listener}"
					acceptedTypes="#{fileUploadBean.acceptedTypes}"
					maxFilesQuantity="1"
					onuploadcomplete="#{rich:component('popup')}.hide(); return true;">
					<!-- 			<a4j:ajax event="uploadcomplete" execute="@none" render="info" /> -->
				</rich:fileUpload>
				<h:commandButton id="done" value="Cancel"
					onclick="#{rich:component('popup')}.hide(); return false;" />
			</h:form>
		</rich:popupPanel>
	</ui:define>
</ui:composition>
